package com.bigknow.appstore.proxy.server;

import com.bigknow.appstore.proxy.entity.ProxyMeta;
import com.bigknow.appstore.proxy.enumerate.ProxyState;
import com.bigknow.appstore.proxy.exceptions.processor.IErrorProcessor;
import com.bigknow.appstore.proxy.handler.base.BaseInboundHandler;
import com.bigknow.appstore.proxy.handler.base.BaseOutboundHandler;
import com.bigknow.appstore.proxy.timetask.ITimeWorker;

import java.util.List;
import java.util.Map;

/**
 * Created by chaos on 2016/9/8.
 */
public interface IProxyServer {

    String getName();

    String getProxyId();

    void startProxy();

    void pauseProxy();

    void resumeProxy();

    void stopProxy();

    ProxyState getState();

    void setState(ProxyState state);

    ProxyMeta getProxyMeta();

    Map<String, ITimeWorker> getTimeWorkerMap();

    int getTimeout();

    String getRealServerIp();

    void setRealServerIp(String realServerIp);

    IErrorProcessor getErrorProcessor();

    /**
     * 添加自定义的inboundHandler
     * @param inboundHandler
     */
    void addCustomInboundHandler(BaseInboundHandler inboundHandler);

    void removeCustomInboundHandler(BaseInboundHandler inboundHandler);

    void setCustomInboundHandlers(List<BaseInboundHandler> customInboundHandlers);

    List<BaseInboundHandler> getCustomInboundHandlers();

    /**
     * 添加额外的outboundHandler
     * @param outboundHandler
     */
    void addCustomOutboundHandler(BaseOutboundHandler outboundHandler);

    void removeCustomOutboudHandler(BaseOutboundHandler outboundHandler);

    List<BaseOutboundHandler> getCustomOutboudHandlers();

    void setCustomOutboudHandlers(List<BaseOutboundHandler> customOutboudHandlers);

    String getRealAppSysPort();

    void setRealAppSysPort(String realAppSysPort);
}
